from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action

class sea3bag(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        
        # build list of actions
        self.add_action(StayinBoat)
        self.add_action(StabShark)
        self.add_action(IgnoreShark)
    
    # return description of room.
    def get_description(self):
        #return "You're hungry [if only you'd brought extra food]!!!!!! \n Suddenly, you see your emergency rations bag floating on the water \n 20 yds from the boat. \n Unfortunately, a large tiger shark sees the same thing and \n is swimming within arm's reach. What should you do?"
        return "Hunger is starting to set in and you've started to hallucinate. As you peek out over the gunnel of your raft, you see your emergency rations bag floating just 20-yards away. As you ready yourself to jump in after it, you see a rather large tiger shark swimming around the bag. What do you do?  Ignore the shark and swim to the supplies, stab the shark and get supplies or stay in the boat?"
    # return image of room
    def get_image(self):
        return 'sea3bag_pic.jpg'


class Sea3BagHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return sea3bag

# define actions for this room

class StayinBoat(Action):
    def __init__(self):
        Action.__init__(self, "StayInBoat")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Stay in the boat"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea5starvation'
    
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

class StabShark(Action):
    def __init__(self):
        Action.__init__(self, "StabShark")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Stab Shark and get supplies"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea4sharkdeath'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    

class IgnoreShark(Action):
    def __init__(self):
        Action.__init__(self, "IgnoreShark")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Ignore shark and swim to supplies"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea6fishing'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"